﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Import_bbs_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            bd();
        }
    }

    private void bd()
    {
        CMSModel.CMSEntities dal = DAL.DBManager.GetCmsEmtity();
        var data = dal.BBSMatching.Select(x => new { LocalTypeName = dal.NewsType.FirstOrDefault(t => t.id == x.localTypeId).name, LocalTypeId = x.localTypeId, BBSTypeName = x.BBSName, BbsId = x.BbsId, CTime = x.CTime });
        Repeater1.DataSource = data;
        Repeater1.DataBind();
    }
    protected void btnImportAll_Click(object sender, EventArgs e)
    {
        BLL.BBSBLL bbsbbl = new BLL.BBSBLL();
        bbsbbl.Imort();
        ClientScript.RegisterStartupScript(GetType(), "aa", "alert('添加成功');document.location='导入成功'");
    }
}